package com.styytech.dadabao.ui.more;


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.lidroid.xutils.view.annotation.ContentView;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.styytech.dadabao.DadaApplication;
import com.styytech.dadabao.R;
import com.styytech.dadabao.base.BaseActivity;
import com.styytech.dadabao.utils.CommonUtils;

/**
 * 关于我们
 */
@ContentView(R.layout.activity_about_us)
public class AboutUsActivity extends BaseActivity {

    /*标题*/
    @ViewInject(R.id.tv_aboutus_title)
    TextView tv_aboutus_title;
    /*内容*/
    @ViewInject(R.id.tv_aboutus_content)
    TextView tv_aboutus_content;
    /*版本号*/
    @ViewInject(R.id.tv_aboutus_version)
    TextView tv_aboutus_version;

    /*上下文*/
    private Context mContext;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mContext = this;
        initView();
        initData();
    }

    /**
     * 初始化视图
     */
    private void initView() {
        DadaApplication.addActivity(this);
        setTopBar(resources.getString(R.string.my_about_us), View.VISIBLE);
        /*版本号*/
        tv_aboutus_version.setText(CommonUtils.getVersionName(mContext));

    }

    /**
     * 初始界面设置
     */
    private void initData() {
    }

    /**
     * 启动界面
     *
     * @param cls 需要启动的界面类
     */
    private void startNextActivity(Class<?> cls) {
        Intent intent = new Intent(mContext, cls);
        startActivity(intent);
    }

    /**
     * 提示消息
     *
     * @param str 需要提示的消息
     */
    private void toast(String str) {
        Toast.makeText(mContext, str, Toast.LENGTH_SHORT).show();
    }

}

